package com.yihukurama.sysbase.common.enums;

import lombok.Getter;

/**
 * 功能描述: 图片类型
 *
 */
@Getter
public enum ImageEnum {

    OTHER_IMG(10, "common", "未分类图片"),
    DESIGNER_IMG(20, "remark", "设计师简介图片"),
    APP_USER_HEAD_IMG(30, "appUserHead", "app用户头像图片"),
    ;

    //类型
    private final int type;
    //标识
    private final String tag;
    //说明
    private final String explain;

    ImageEnum(int type, String tag, String explain) {
        this.type = type;
        this.tag = tag;
        this.explain = explain;
    }

    public static ImageEnum buildByType(Integer type) {
        if (type == null) {
            return null;
        }
        for (ImageEnum imageEnum : ImageEnum.values()) {
            if (imageEnum.getType() == type) {
                return imageEnum;
            }
        }
        return null;
    }


}
